/**
 * api for user onlie
 * @returns {Promise<Response>}
 */
import { httpDel, httpGet, httpPost, httpPut } from '../index'

export function page (query) {
  return httpGet('/api/admin/job/page', query)
}

export function addObj (obj) {
  return httpPost('/api/admin/job', obj)
}

export function getObj (id) {
  return httpGet('/api/admin/job/' + id)
}

export function delObj (id) {
  return httpDel('/api/admin/job/' + id)
}

export function putObj (id, obj) {
  return httpPut('/api/admin/job/' + id, obj)
}

export function delObjs (ids) {
  let data = { ids }
  return httpDel('/api/admin/job/delete', data)
}

export function resume (ids) {
  let data = { ids }
  return httpPost('/api/admin/job/resume', data)
}

export function pause (ids) {
  let data = { ids }
  return httpPost('/api/admin/job/pause', data)
}

export function run (ids) {
  let data = { ids }
  return httpPost('/api/admin/job/run', data)
}
